/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package fonol.entidades;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Fredfred2
 */
@Entity
@Table(name = "HISTORIALPANTALLAS")
@SequenceGenerator(name="seqHis",allocationSize=1,initialValue=1,sequenceName="HISTORIALPANTALLAS_SEQ")
@NamedQueries({@NamedQuery(name = "Historialpantallas.findByIdhistorial", query = "SELECT h FROM Historialpantallas h WHERE h.idhistorial = :idhistorial"), @NamedQuery(name = "Historialpantallas.findByPantalla", query = "SELECT h FROM Historialpantallas h WHERE h.pantalla = :pantalla"), @NamedQuery(name = "Historialpantallas.findByOperacion", query = "SELECT h FROM Historialpantallas h WHERE h.operacion = :operacion"), @NamedQuery(name = "Historialpantallas.findByFecha", query = "SELECT h FROM Historialpantallas h WHERE h.fecha = :fecha")})
public class Historialpantallas implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy=GenerationType.SEQUENCE,generator="seqHis")
    @Column(name = "IDHISTORIAL", nullable = false)
    private Integer idhistorial;
    @Column(name = "PANTALLA")
    private String pantalla;
    @Column(name = "OPERACION")
    private String operacion;
    @Column(name = "FECHA")
    @Temporal(TemporalType.DATE)
    private Date fecha;
    @JoinColumn(name = "IDUSUARIO", referencedColumnName = "IDUSUARIO")
    @ManyToOne
    private Usuarios usuario;

    public Historialpantallas() {
    }

    public Historialpantallas(Integer idhistorial) {
        this.idhistorial = idhistorial;
    }

    public Integer getIdhistorial() {
        return idhistorial;
    }

    public void setIdhistorial(Integer idhistorial) {
        this.idhistorial = idhistorial;
    }

    public String getPantalla() {
        return pantalla;
    }

    public void setPantalla(String pantalla) {
        this.pantalla = pantalla;
    }

    public String getOperacion() {
        return operacion;
    }

    public void setOperacion(String operacion) {
        this.operacion = operacion;
    }

    public Date getFecha() {
        return fecha;
    }

    public void setFecha(Date fecha) {
        this.fecha = fecha;
    }

    public Usuarios getIdusuario() {
        return usuario;
    }

    public void setIdusuario(Usuarios idusuario) {
        this.usuario = idusuario;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idhistorial != null ? idhistorial.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Historialpantallas)) {
            return false;
        }
        Historialpantallas other = (Historialpantallas) object;
        if ((this.idhistorial == null && other.idhistorial != null) || (this.idhistorial != null && !this.idhistorial.equals(other.idhistorial))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "fonol.entidades.Historialpantallas[idhistorial=" + idhistorial + "]";
    }

}
